<%@page pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>Insert title here</title>
		<title>Insert title here</title>
		<link href="../style/style.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript">
			function doSave(){
				//获得form对象
				var formObj = document.forms["uform"];
				if(validate(formObj)){
					formObj.submit();
				}
			}
			function validate(formObj){
				//获得选项数组
				var answerArray = formObj.answer;
				//判断数组中是有选中，如果有选中就可以提交，如果没有选中就提示用户选中一个答案
				for(var i = 0;i < answerArray.length;i++){
					if(answerArray[i].checked){
						return true;
					}
				}
				alert("请您选中一个正确答案.");
				return false;
			}
		</script>
	</head>
	<body style="overflow: scroll; overflow-y: hidden">
		<div>

			<div id="right">
				<!--right_top-->
				<div class="right_top">
					<p>
						试题添加
					</p>
				</div>
				<div class="right_bottom" style="border: 0px solid red;">

					<!--baise-->
					<div class="baise" >

						<form  name="uform" method="post"
							action="${pageContext.request.contextPath }/servlet/examInsert">
							<input type="hidden" name="command" value="add">
							<table width="10%" class="table" cellspacing="1"
								style="background: #FFFFFF; font-size: 12px;  margin: 0 auto; border: 0;">
							
								
								<tr style="background: #FFFFFF; border: 0;">
									<td nowrap="nowrap" height="30" align="right" width="46%">
										<span style="font-weight: bold; color: #296DB8;">题目 :</span>
									</td>
									<td width="54%" style="text-align: left; padding-left: 10px;">
										<textarea name="title" cols="100">He has a____habit of biting his lips lips when he is puzzled.</textarea>

									</td>
								</tr>
								
								<tr
									style="background: #FFFFFF; border: 1; margin-top: 10px; height: 25px;">
									<td style="width: ;" align="right">
										<span style="font-weight: bold; color: #296DB8;">A,</span>
									</td>
									<td style="text-align: left; padding-left: 10px;">
										<input id="option1" name="optionA" type="text" maxlength="20"
											style="width: 800px; padding-left: 5px; border: none; border: solid 1px #C4D0CC;"
											value="partcular" />
									</td>

								</tr>

								<tr
									style="background: #FFFFFF; border: 0; margin-top: 10px; height: 25px;">
									<td style="width: ;" align="right">
										<span style="font-weight: bold; color: #296DB8;">B,</span>
									</td>
									<td style="text-align: left; padding-left: 10px;">
										<input id="option2" name="optionB" type="text" maxlength="20"
											style="width: 800px; padding-left: 5px; border: none; border: solid 1px #C4D0CC;"
											value="specific" />
									</td>
								</tr>

								<tr
									style="background: #FFFFFF; border: 0; margin-top: 10px; height: 25px;">
									<td align="right">
										<span style="font-weight: bold; color: #296DB8;">C,</span>
									</td>
									<td style="text-align: left; padding-left: 10px;">
										<input id="option3" name="optionC" type="text" maxlength="20"
											style="width: 800px; padding-left: 5px; border: none; border: solid 1px #C4D0CC;"
											value="peculiar" />
									</td>
								</tr>
								<tr
									style="background: #FFFFFF; border: 0; margin-top: 10px; height: 25px;">

									<td height="20" align="right">
										<span style="font-weight: bold; color: #296DB8;">D,</span>
									</td>
									<td style="text-align: left; padding-left: 10px;">
										<input name="optionD" type="text" id="option4"
											style="width: 800px; padding-left: 5px; border: none; border: solid 1px #C4D0CC;"
											value="general" size="300" maxlength="200" />
									</td>
								</tr>

								<tr
									style="background: #FFFFFF; border: 0; margin-top: 10px; height: 25px;">
									<td height="112" align="right">

									</td>
									<td align="center" valign="middle"
										style="text-align: left; padding-left: 10px;">
										<p>
											<span style="font-weight: bold; color: #296DB8;">请选择正确答案：</span>
										</p>
										<p>
											&nbsp;
										</p>

										<p style="padding-left: 20px">

											<input type="radio" name="answer" value="A"
												id="RadioGroup1_0" />
											A

											<input type="radio" name="answer" value="B"
												id="RadioGroup1_1" />
											B

											<input type="radio" name="answer" value="C"
												id="RadioGroup1_2" />
											C

											<input type="radio" name="answer" value="D"
												id="RadioGroup1_3" />
											D
										</p>

										<p>
											&nbsp;
										</p>
										<p>
									

											
											<input name="input" value="清除" type="reset"
												style="cursor:pointer;background: none; border: none; width: 70px; height: 23px; background: url(../images/button.jpg) no-repeat; color: #FFFFFF; font-size: 14px;"
												 />
											<input name="input" value="确定" type="button"
												style="cursor:pointer;background: none; border: none; width: 70px; height: 23px; background: url(../images/button.jpg) no-repeat; color: #FFFFFF; font-size: 14px;"
												onclick="doSave()" />
											<br />
										</p>

										<div></div>
									</td>
								</tr>

							</table>
						</form>
					</div>
				</div>

			</div>
		</div>
		</div>
		</div>
	</body>
</html>
